package com.controller;

import com.pojo.SysUser;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Controller
@RequestMapping("/test")
public class TestController {

    @RequestMapping("add1")
    public String add(){
        return "add";
    }

    @RequestMapping("/save")
    public String save(/**Model model*/Map<String,Object> map, @RequestParam String realName, String password) throws Exception{
//        SysUser sysUser = new SysUser();
//        sysUser.setRealName(realName);
//        sysUser.setPassword(password);
//        model.addAttribute("sysUser",sysUser);
//        model.addAttribute(sysUser);
        map.put("realName",realName);
        map.put("password",password);
        return "add";
    }
}
